<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>迅腾报表后台管理</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="__WZHADMIN__assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="__WZHADMIN__assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="__WZHADMIN__assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="__WZHADMIN__assets/css/admin.css">
    <link rel="stylesheet" href="__WZHADMIN__assets/css/app.css">
    <style>
        .container #edui1{
            width: 800px !important;
        }
        .container #edui1_iframeholder{
            width: 800px !important;
        }
    </style>
</head>
<body data-type="generalComponents">

{include file='Public:header'}

{include file='Public:menu'}




        <div class="tpl-content-wrapper">

            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="{:url('admin/Index/index')}">项目管理</a></li>
                <li class="am-active">添加项目</li>
            </ol>
            <div class="tpl-portlet-components">

                <div class="tpl-block ">

                    <div class="am-g tpl-amazeui-form">


                        <div class="am-u-sm-12 am-u-md-9">
                            <form class="am-form am-form-horizontal"  enctype="multipart/form-data">
                                <div class="am-form-group">
                                    <label for="title" class="am-u-sm-2 am-form-label">标题</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="title" name="title" placeholder="请输入标题">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="address" class="am-u-sm-2 am-form-label">地址</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="address" name="address" placeholder="请输入地址">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="unit" class="am-u-sm-2 am-form-label">业主单位</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="unit" name="unit" placeholder="请输入业主单位">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="operator" class="am-u-sm-2 am-form-label">投标经办人</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="operator" name="operator" placeholder="请输入投标经办人">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="principal" class="am-u-sm-2 am-form-label">投标负责人</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="principal" name="principal" placeholder="请输入投标负责人">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="infrastructure" class="am-u-sm-2 am-form-label">基建负责人</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="infrastructure" name="infrastructure" placeholder="请输入基建负责人">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                <label for="manager" class="am-u-sm-2 am-form-label">总经理</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="manager" name="manager" placeholder="请输入总经理">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="mobile" class="am-u-sm-2 am-form-label">联系方式</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="mobile" name="mobile" placeholder="请输入联系方式">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="bid_time" class="am-u-sm-2 am-form-label">投标时间</label>
                                    <div class="am-u-sm-10">
                                        <input type="date" id="bid_time" name="bid_time" placeholder="请输入投标时间">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="bid_money" class="am-u-sm-2 am-form-label">投标金额</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="bid_money" name="bid_money" placeholder="请输入投标金额">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="content" class="am-u-sm-2 am-form-label">投标内容简述</label>
                                    <div class="am-u-sm-10">
                                        <textarea class="content" name="content"  rows="5" id="content"></textarea>
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label  class="am-u-sm-2 am-form-label">类别</label>
                                    <div class="am-u-sm-10">
                                        <select name="is_completion" id="is_completion">
                                            <option value="1">跟踪项目</option>

                                            <option value="2">在建项目</option>

                                            <option value="3">已完成</option>
                                        </select>

                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label  class="am-u-sm-2 am-form-label">类别</label>
                                    <div class="am-u-sm-10">
                                        <select name="type" id="type">
                                            <option value="1">电网</option>
                                            <option value="2">市政</option>
                                            <option value="3">商业</option>
                                            <option value="4">新源</option>
                                            <option value="5">挂靠</option>
                                        </select>

                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="order" class="am-u-sm-2 am-form-label">工程编号</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="order" name="order" placeholder="请输入工程编号">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="leader" class="am-u-sm-2 am-form-label">项目负责人</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="leader" name="leader" placeholder="请输入项目负责人">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="people" class="am-u-sm-2 am-form-label">项目相关人员</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="people" name="people" placeholder="请输入项目相关人员">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="contract_time" class="am-u-sm-2 am-form-label">合同签订时间</label>
                                        <div class="am-u-sm-10">
                                            <input type="date" id="contract_time" name="contract_time" placeholder="请输入合同签订时间">
                                        </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="end_time" class="am-u-sm-2 am-form-label">合同到期时间</label>
                                    <div class="am-u-sm-10">
                                        <input type="date" id="end_time" name="end_time" placeholder="请输入合同到期时间">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="contract_amount" class="am-u-sm-2 am-form-label">合同总金额</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="contract_amount" name="contract_amount" placeholder="请输入合同总金额">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="settlement" class="am-u-sm-2 am-form-label">结算金额</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="settlement" name="settlement" placeholder="请输入结算金额">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="uncollected" class="am-u-sm-2 am-form-label">应收账款</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="uncollected" name="uncollected" placeholder="请输入应收账款">
                                    </div>
                                </div>


                                <div class="am-form-group">
                                    <label for="capital" class="am-u-sm-2 am-form-label">占用资金</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="capital" name="capital" placeholder="请输入占用资金">
                                    </div>
                                </div>


                                <div class="am-form-group">
                                    <label for="to1_time" class="am-u-sm-2 am-form-label">到款时间1</label>
                                    <div class="am-u-sm-10">
                                        <input type="date" id="to1_time" name="to1_time" placeholder="请输入合同到款时间">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label  class="am-u-sm-2 am-form-label">收款状态1</label>
                                    <div class="am-u-sm-10">
                                        <select name="to1_status" id="to1_status">
                                            <option value="0">未到款</option>
                                            <option value="1">已付款</option>
                                        </select>

                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="to1_msg" class="am-u-sm-2 am-form-label">到款说明1</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="to1_msg" name="to1_msg" placeholder="请输入到款说明">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="to2_time" class="am-u-sm-2 am-form-label">到款时间2</label>
                                    <div class="am-u-sm-10">
                                        <input type="date" id="to2_time" name="to2_time" placeholder="请输入合同到款时间">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label  class="am-u-sm-2 am-form-label">收款状态2</label>
                                    <div class="am-u-sm-10">
                                        <select name="to2_status" id="to2_status">
                                            <option value="0">未到款</option>
                                            <option value="1">已付款</option>
                                        </select>

                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="to2_msg" class="am-u-sm-2 am-form-label">到款说明2</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="to2_msg" name="to2_msg" placeholder="请输入到款说明">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="to3_time" class="am-u-sm-2 am-form-label">到款时间3</label>
                                    <div class="am-u-sm-10">
                                        <input type="date" id="to3_time" name="to3_time" placeholder="请输入合同到款时间">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label  class="am-u-sm-2 am-form-label">收款状态3</label>
                                    <div class="am-u-sm-10">
                                        <select name="to3_status" id="to3_status">
                                            <option value="0">未到款</option>
                                            <option value="1">已付款</option>
                                        </select>

                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="to3_msg" class="am-u-sm-2 am-form-label">到款说明3</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="to3_msg" name="to3_msg" placeholder="请输入到款说明">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="to4_time" class="am-u-sm-2 am-form-label">到款时间4</label>
                                    <div class="am-u-sm-10">
                                        <input type="date" id="to4_time" name="to4_time" placeholder="请输入合同到款时间">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label  class="am-u-sm-2 am-form-label">收款状态4</label>
                                    <div class="am-u-sm-10">
                                        <select name="to4_status" id="to4_status">
                                            <option value="0">未到款</option>
                                            <option value="1">已付款</option>
                                        </select>

                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="to4_msg" class="am-u-sm-2 am-form-label">到款说明4</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="to4_msg" name="to4_msg" placeholder="请输入到款说明">
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="to5_time" class="am-u-sm-2 am-form-label">到款时间5</label>
                                    <div class="am-u-sm-10">
                                        <input type="date" id="to5_time" name="to5_time" placeholder="请输入合同到款时间">
                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label  class="am-u-sm-2 am-form-label">收款状态5</label>
                                    <div class="am-u-sm-10">
                                        <select name="to5_status" id="to5_status">
                                            <option value="0">未到款</option>
                                            <option value="1">已付款</option>
                                        </select>

                                    </div>
                                </div>
                                <div class="am-form-group">
                                    <label for="to5_msg" class="am-u-sm-2 am-form-label">到款说明5</label>
                                    <div class="am-u-sm-10">
                                        <input type="text" id="to5_msg" name="to5_msg" placeholder="请输入到款说明">
                                    </div>
                                </div>




                                <div class="am-form-group">
                                    <div class="am-u-sm-10 am-u-sm-push-2">
                                        <button type="button" class="am-btn am-btn-primary" onclick="submitFun()">保存</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>










        </div>

    </div>


    <script src="__WZHADMIN__assets/js/jquery.min.js"></script>
    <script src="__WZHADMIN__assets/js/amazeui.min.js"></script>
    <script src="__WZHADMIN__assets/js/app.js"></script>


    <script>
        function submitFun() {
            $data= {
                'title': $('#title').val(),
                'address': $('#address').val(),
                'unit': $('#unit').val(),
                'operator': $('#operator').val(),
                'principal': $('#principal').val(),
                'infrastructure': $('#infrastructure').val(),
                'manager': $('#manager').val(),
                'mobile': $('#mobile').val(),
                'bid_time': $('#bid_time').val(),
                'bid_money': $('#bid_money').val(),
                'content': $('#content').val(),
                'is_completion': $('#is_completion').val(),
                'type': $('#type').val(),
                'order': $('#order').val(),
                'leader': $('#leader').val(),
                'people':$('#people').val(),
                'contract_time': $('#contract_time').val(),
                'end_time':$('#end_time').val(),
                'uncollected': $('#uncollected').val(),
                'contract_amount': $('#contract_amount').val(),
                'settlement': $('#settlement').val(),
                'capital': $('#capital').val(),
                'to1_time': $('#to1_time').val(),
                'to1_msg': $('#to1_msg').val(),
                'to1_status': $('#to1_status').val(),
                'to2_time': $('#to2_time').val(),
                'to2_msg': $('#to2_msg').val(),
                'to2_status': $('#to2_status').val(),
                'to3_time': $('#to3_time').val(),
                'to3_msg': $('#to3_msg').val(),
                'to3_status': $('#to3_status').val(),
                'to4_time': $('#to4_time').val(),
                'to4_msg': $('#to4_msg').val(),
                'to4_status': $('#to4_status').val(),
                'to5_time': $('#to5_time').val(),
                'to5_msg': $('#to5_msg').val(),
                'to5_status': $('#to5_status').val(),

            }
            if ($data.title==''){
                alert('项目名称不能为空');
                return false;
            }
            if ($data.unit==''){
                alert('业主单位不能为空');
                return false;
            }
            if ($data.order==''){
                alert('项目工程编号不能为空');
                return false;
            }
            // alert($data.is_completion);
            if ($data.is_completion>1) {
                if ($data.order==''){
                    alert('在建（已完工）项目工程编号不能为空');
                    return false;
                }
                if ($data.leader==''){
                    alert('在建（已完工）项目负责人不能为空');
                    return false;
                }
                if ($data.contract_time==''){
                    alert('在建（已完工）合同签订时间不能为空');
                    return false;
                }
                if ($data.end_time==''){
                    alert('在建（已完工）合同到期时间不能为空');
                    return false;
                }
                if ($data.contract_amount==''){
                    alert('在建（已完工）合同金额不能为空');
                    return false;
                }
                if ($data.capital==''){
                    alert('在建（已完工）占用资金不能为空');
                    return false;
                }
                if ($data.uncollected==''){
                    alert('在建（已完工）应收账款不能为空');
                    return false;
                }
                if ($data.settlement==''){
                    alert('在建（已完工）结算金额不能为空');
                    return false;
                }
            }
            $.ajax({
                type:"post",
                url:"{:url('admin/Index/doAdd')}",
                async:true,
                data:$data,
                dataType:'json',
                success(xhr){
                    alert(xhr.msg)
                    if (xhr.code==1)
                    {
                        window.location.href="{:url('admin/Index/index')}"
                    }
                }
            });

        }
    </script>

</body>

</html>